package com.yuandian.management.enums;

/**
 * 说明：单位类型枚举类
 * @Author tianlr
 * @Date 2023/6/9 09:55
 */

public enum OrgTypeEnum {
    GROUPHEADQUARTERS("1", "集团总部"),
    PROVINCIALCOMPANY("2", "省公司"),
    UNITSDIRECTLYUNDER("3", "直属单位"),
    PROFESSIONALCOMPANY("4", "专业公司"),
    OVERSEASCOMPANIES("5", "境外公司"),
    OTHER("6", "其他");

    private String item;
    private String itemValue;
    OrgTypeEnum(String item, String itemValue){
        this.item = item;
        this.itemValue = itemValue;
    }

    public static String getItemValue(String item) {
        for (OrgTypeEnum m : OrgTypeEnum.values()) {
            if ((m.item).equals(item)) {
                return m.itemValue;
            }
        }
        return "";
    }

    public static String getItemKey(String itemValue) {
        for (OrgTypeEnum m : OrgTypeEnum.values()) {
            if ((m.itemValue).equals(itemValue)) {
                return m.item;
            }
        }
        return OTHER.item;
    }
}
